Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Pushing and Popping the Graphics State

QuickDraw 3D maintains a graphics state during rendering that contains camera and lighting information, a transformation matrix stack, an attributes stack, and a style stack. When it is traversing a hierarchical scene database, QuickDraw 3D automatically pushes and pops graphics states onto and off the graphics state stack.

QuickDraw 3D provides routines that you can use to push and pop a graphics state during the rendering of an image or other view operation. You can push a graphics state by calling Q3Push_Submit . Subsequent rendering may alter the graphics state by drawing materials, styles, and transforms. You can restore a saved graphics state by calling Q3Pop_Submit . You're likely to use these functions only if you want to simulate the traversal of a hierarchical structure when operating in immediate mode.

Q3Push_Submit

You can use the Q3Push_Submit function to push a graphics state onto the graphics state stack.

TQ3Status Q3Push_Submit (TQ3ViewObject view);
view
A view.

DESCRIPTION

The Q3Push_Submit function pushes the current graphics state of the view specified by the view parameter onto the graphics state stack. There must be a matching call to Q3Pop_Submit before the next call to Q3View_EndRendering .

SPECIAL CONSIDERATIONS

You should call Q3Push_Submit only in a submitting loop.

Q3Pop_Submit

You can use the Q3Pop_Submit function to pop a graphics state off the graphics state stack.

TQ3Status Q3Pop_Submit (TQ3ViewObject view);
view
A view.

DESCRIPTION

The Q3Pop_Submit function pops the graphics state of the view specified by the view parameter off the graphics state stack. Every call to Q3Pop_Submit must match a previous call to Q3Push_Submit .

SPECIAL CONSIDERATIONS

You should call Q3Pop_Submit only in a submitting loop.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |